<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Social Media Mapper</title>
</head>
  <body>

<%
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    if (user != null) {
%>
<p>Hello, <%= user.getNickname() %>! (You can
<a href="<%= userService.createLogoutURL(request.getRequestURI()) %>">sign out</a>.)</p>
<%
    } else {
%>

<p>Hello! Enter your search term: 
<!-- <a href="<%= userService.createLoginURL(request.getRequestURI()) %>">Sign in</a>
to include your name with greetings you post.</p>
 -->
 <%
    }
%>

 <form action="/query" method="post">
    <div><textarea name="queryStr" rows="1" cols="60"></textarea></div><br />
    <div>
    	<input type="checkbox" name="services" value="twitter" checked /> Search Twitter<br />
		<input type="checkbox" name="services" value="flickr" checked /> Search Flickr <br /> 
    </div>
    <div><input type="submit" value="Search" /></div>
  </form>
  </body>
</html>